home *** CD-ROM | disk | FTP | other *** search
/ Diccionario Visual Trilingue / VISUAL.iso / SHARED.DIR / 10091_InitializeFiles (Index).ls < prev    next >
Encoding:
Text File  |  1997-07-04  |  6.2 KB  |  159 lines

  1. global gNbWord, gTextLanguage, gInterfaceLanguage, gCurrentPos, gListWordFrench, gNbItem, gListWordEnglish, gNbWordMax, gDataPath, gListWordSpanish, gTermObj, gIdxTermObj, gIndexPicObj
  2.  
  3. on InitializeFiles
  4.   if getAt(gNbWord, gTextLanguage) = 0 then
  5.     set gNbWord to [0, 0, 0]
  6.     set gNbItem to [0, 0, 0]
  7.     set gNbWordMax to [0, 0, 0]
  8.     set gListWordFrench to []
  9.     set gListWordEnglish to []
  10.     set gListWordSpanish to []
  11.     addRAMobjects(#CastList, [10529, 10556])
  12.     set the text of cast 10556 to getString(#wait, gInterfaceLanguage)
  13.     set the castNum of sprite 35 to 10529
  14.     set the locH of sprite 35 to 320
  15.     set the locV of sprite 35 to 220
  16.     set the castNum of sprite 36 to 10556
  17.     set the ink of sprite 36 to 36
  18.     set the locH of sprite 36 to 181
  19.     set the locV of sprite 36 to 205
  20.     puppetTransition(9, 0, 5)
  21.     updateStage()
  22.     puppetTransition(0)
  23.     set gCurrentPos to [1, 1, 1]
  24.     if gTextLanguage = 1 then
  25.       set gListWordFrench to []
  26.       set fileObj1 to FileIO(mnew, "read", gDataPath & "words1.001")
  27.       set theLine1 to fileObj1(mReadFile)
  28.       add(gListWordFrench, value(theLine1))
  29.       if objectp(fileObj1) then
  30.         fileObj1(mdispose)
  31.       end if
  32.       set fileObj2 to FileIO(mnew, "read", gDataPath & "words2.001")
  33.       set theLine1 to fileObj2(mReadFile)
  34.       add(gListWordFrench, value(theLine1))
  35.       if objectp(fileObj2) then
  36.         fileObj2(mdispose)
  37.       end if
  38.       set fileObj3 to FileIO(mnew, "read", gDataPath & "words3.001")
  39.       set theLine1 to fileObj3(mReadFile)
  40.       add(gListWordFrench, value(theLine1))
  41.       if objectp(fileObj3) then
  42.         fileObj3(mdispose)
  43.       end if
  44.       set fileObj4 to FileIO(mnew, "read", gDataPath & "words4.001")
  45.       set theLine1 to fileObj4(mReadFile)
  46.       add(gListWordFrench, value(theLine1))
  47.       if objectp(fileObj4) then
  48.         fileObj4(mdispose)
  49.       end if
  50.       set fileObj5 to FileIO(mnew, "read", gDataPath & "words5.001")
  51.       set theLine1 to fileObj5(mReadFile)
  52.       add(gListWordFrench, value(theLine1))
  53.       if objectp(fileObj5) then
  54.         fileObj5(mdispose)
  55.       end if
  56.       setAt(gNbWordMax, gTextLanguage, count(getAt(gListWordFrench, 1)))
  57.       setAt(gNbWord, gTextLanguage, (getAt(gNbWordMax, gTextLanguage) * 4) + count(getAt(gListWordFrench, 5)))
  58.     else
  59.       if gTextLanguage = 2 then
  60.         set gListWordEnglish to []
  61.         set fileObj1 to FileIO(mnew, "read", gDataPath & "words1.002")
  62.         set theLine1 to fileObj1(mReadFile)
  63.         add(gListWordEnglish, value(theLine1))
  64.         if objectp(fileObj1) then
  65.           fileObj1(mdispose)
  66.         end if
  67.         set fileObj2 to FileIO(mnew, "read", gDataPath & "words2.002")
  68.         set theLine1 to fileObj2(mReadFile)
  69.         add(gListWordEnglish, value(theLine1))
  70.         if objectp(fileObj2) then
  71.           fileObj2(mdispose)
  72.         end if
  73.         set fileObj3 to FileIO(mnew, "read", gDataPath & "words3.002")
  74.         set theLine1 to fileObj3(mReadFile)
  75.         add(gListWordEnglish, value(theLine1))
  76.         if objectp(fileObj3) then
  77.           fileObj3(mdispose)
  78.         end if
  79.         set fileObj4 to FileIO(mnew, "read", gDataPath & "words4.002")
  80.         set theLine1 to fileObj4(mReadFile)
  81.         add(gListWordEnglish, value(theLine1))
  82.         if objectp(fileObj4) then
  83.           fileObj4(mdispose)
  84.         end if
  85.         set fileObj5 to FileIO(mnew, "read", gDataPath & "words5.002")
  86.         set theLine1 to fileObj5(mReadFile)
  87.         add(gListWordEnglish, value(theLine1))
  88.         if objectp(fileObj5) then
  89.           fileObj5(mdispose)
  90.         end if
  91.         setAt(gNbWordMax, gTextLanguage, count(getAt(gListWordEnglish, 1)))
  92.         setAt(gNbWord, gTextLanguage, (getAt(gNbWordMax, gTextLanguage) * 4) + count(getAt(gListWordEnglish, 5)))
  93.       else
  94.         if gTextLanguage = 3 then
  95.           set gListWordSpanish to []
  96.           set fileObj1 to FileIO(mnew, "read", gDataPath & "words1.003")
  97.           set theLine1 to fileObj1(mReadFile)
  98.           add(gListWordSpanish, value(theLine1))
  99.           if objectp(fileObj1) then
  100.             fileObj1(mdispose)
  101.           end if
  102.           set fileObj2 to FileIO(mnew, "read", gDataPath & "words2.003")
  103.           set theLine1 to fileObj2(mReadFile)
  104.           add(gListWordSpanish, value(theLine1))
  105.           if objectp(fileObj2) then
  106.             fileObj2(mdispose)
  107.           end if
  108.           set fileObj3 to FileIO(mnew, "read", gDataPath & "words3.003")
  109.           set theLine1 to fileObj3(mReadFile)
  110.           add(gListWordSpanish, value(theLine1))
  111.           if objectp(fileObj3) then
  112.             fileObj3(mdispose)
  113.           end if
  114.           set fileObj4 to FileIO(mnew, "read", gDataPath & "words4.003")
  115.           set theLine1 to fileObj4(mReadFile)
  116.           add(gListWordSpanish, value(theLine1))
  117.           if objectp(fileObj4) then
  118.             fileObj4(mdispose)
  119.           end if
  120.           set fileObj5 to FileIO(mnew, "read", gDataPath & "words5.003")
  121.           set theLine1 to fileObj5(mReadFile)
  122.           add(gListWordSpanish, value(theLine1))
  123.           if objectp(fileObj5) then
  124.             fileObj5(mdispose)
  125.           end if
  126.           setAt(gNbWordMax, gTextLanguage, count(getAt(gListWordSpanish, 1)))
  127.           setAt(gNbWord, gTextLanguage, (getAt(gNbWordMax, gTextLanguage) * 4) + count(getAt(gListWordSpanish, 5)))
  128.         end if
  129.       end if
  130.     end if
  131.     set gNbItem to [getAt(gNbWord, gTextLanguage), 0, 0]
  132.     set the visible of sprite 48 to 0
  133.     set the visible of sprite 47 to 0
  134.     updateStage()
  135.   end if
  136.   set CurrentPath to gDataPath
  137.   if objectp(gTermObj) then
  138.     gTermObj(mdispose)
  139.   end if
  140.   if objectp(gIdxTermObj) then
  141.     gIdxTermObj(mdispose)
  142.   end if
  143.   if gTextLanguage = 1 then
  144.     set gTermObj to FileIO(mnew, "read", CurrentPath & "terms.001")
  145.     set gIdxTermObj to FileIO(mnew, "read", CurrentPath & "idxterms.001")
  146.   else
  147.     if gTextLanguage = 2 then
  148.       set gTermObj to FileIO(mnew, "read", CurrentPath & "terms.002")
  149.       set gIdxTermObj to FileIO(mnew, "read", CurrentPath & "idxterms.002")
  150.     else
  151.       if gTextLanguage = 3 then
  152.         set gTermObj to FileIO(mnew, "read", CurrentPath & "terms.003")
  153.         set gIdxTermObj to FileIO(mnew, "read", CurrentPath & "idxterms.003")
  154.       end if
  155.     end if
  156.   end if
  157.   set gIndexPicObj to FileIO(mnew, "read", CurrentPath & "Pages_i.all")
  158. end
  159.